﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EAEcoreAddin.SQLWrapperClasses
{
    /*
     *Created by Alexander Schleich
     *for EMoflon:
     *http://www.moflon.org/emoflon/
     */
    class EADiagram : EA.Diagram
    {
        String xmlDiagramString;
        SQLRepository repository;
        public EADiagram(SQLRepository repository, String xmlDiagramString)
        {
            this.repository = repository;
            this.xmlDiagramString = xmlDiagramString;
        }


        #region IDualDiagram Members

        public bool ApplyGroupLock(string aGroupName)
        {
            throw new NotImplementedException();
        }

        public bool ApplyUserLock()
        {
            throw new NotImplementedException();
        }

        public string Author
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public DateTime CreatedDate
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string DiagramGUID
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public int DiagramID
        {
            get 
            {
                return int.Parse( EAEcoreAddin.Util.EAUtil.getXMLNodeContentFromSQLQueryString(xmlDiagramString, "Diagram_ID")[0] );
            }
        }

        public EA.Collection DiagramLinks
        {
            get { throw new NotImplementedException(); }
        }

        public EA.Collection DiagramObjects
        {
            get { throw new NotImplementedException(); }
        }

        public string ExtendedStyle
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string GetLastError()
        {
            throw new NotImplementedException();
        }

        public bool HighlightImports
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public bool IsLocked
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string MetaType
        {
            get 
            {
                String styleExString = EAEcoreAddin.Util.EAUtil.getXMLNodeContentFromSQLQueryString(xmlDiagramString, "StyleEx")[0];
                String[] splitStyleEx = styleExString.Split(';');
                String metatypeEntry = null;
                foreach (String entry in splitStyleEx)
                {
                    if (entry.Contains("MDGDgm="))
                    {
                        metatypeEntry = entry;
                    }
                }
                String[] metatypeSplit = metatypeEntry.Split('=');
                String metaType = metatypeSplit[1];


                return metaType;
            }
        }

        public DateTime ModifiedDate
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Name
        {
            get
            {
                return EAEcoreAddin.Util.EAUtil.getXMLNodeContentFromSQLQueryString(xmlDiagramString, "Name")[0];
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Notes
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public EA.ObjectType ObjectType
        {
            get { throw new NotImplementedException(); }
        }

        public string Orientation
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public int PackageID
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public int ParentID
        {
            get
            {
                return int.Parse(EAEcoreAddin.Util.EAUtil.getXMLNodeContentFromSQLQueryString(xmlDiagramString, "ParentID")[0]);
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public bool ReleaseUserLock()
        {
            throw new NotImplementedException();
        }

        public void ReorderMessages()
        {
            throw new NotImplementedException();
        }

        public bool SaveAsPDF(string sFilename)
        {
            throw new NotImplementedException();
        }

        public int Scale
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public EA.Connector SelectedConnector
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public EA.Collection SelectedObjects
        {
            get { throw new NotImplementedException(); }
        }

        public void ShowAsElementList(bool ShowAsList, bool Persist)
        {
            throw new NotImplementedException();
        }

        public int ShowDetails
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public bool ShowPackageContents
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public bool ShowPrivate
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public bool ShowProtected
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public bool ShowPublic
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Stereotype
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string StereotypeEx
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string StyleEx
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public EA.SwimlaneDef SwimlaneDef
        {
            get { throw new NotImplementedException(); }
        }

        public string Swimlanes
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Type
        {
            get { throw new NotImplementedException(); }
        }

        public bool Update()
        {
            throw new NotImplementedException();
        }

        public string Version
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public int cx
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public int cy
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        #endregion

        #region IDualDiagram Members


        public string ReadStyle(string Style)
        {
            throw new NotImplementedException();
        }

        public void WriteStyle(string Style, string Value)
        {
            throw new NotImplementedException();
        }

        #endregion


        public EA.DiagramObject GetDiagramObjectByID(int nID, string sDUID)
        {
            throw new NotImplementedException();
        }
    }
}
